package com.ihr360.payroll.test.mock;

import com.google.common.collect.ImmutableList;
import com.ihr360.commons.model.type.NumOperation;
import com.ihr360.payroll.model.dto.salary.basecode.SalaryFieldType;
import com.ihr360.payroll.service.payroll.mock.core.TaxTypeHelper;

public class SalaryFieldTypeHelper {
    /**
     * 工资
     *
     * @return
     */
    public static SalaryFieldType salary() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.salary);
        fieldType.setName("工资");
        fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 奖金
     *
     * @return
     */
    public static SalaryFieldType bonus() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.bonus);
        fieldType.setName("奖金");
        fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 税前津补贴
     *
     * @return
     */
    public static SalaryFieldType pretaxallowance() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.pretaxallowance);
        fieldType.setName("税前津补贴");
        fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 税前扣款
     *
     * @return
     */
    public static SalaryFieldType pretaxdeduction() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.pretaxdeduction);
        fieldType.setName("税前扣款");
        fieldType.setCompanycostop(NumOperation.SUBTRACT);
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 应税调整
     *
     * @return
     */
    public static SalaryFieldType taxableadjustment() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.taxableadjustment);
        fieldType.setName("应税调整");
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 劳务费
     *
     * @return
     */
    public static SalaryFieldType laborincome() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.laborincome);
        fieldType.setName("劳务税");
        fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.laborTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 年终奖税
     *
     * @return
     */
    public static SalaryFieldType yearendbonus() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.yearendbonus);
        fieldType.setName("年终奖税");
        fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.annualBonusTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 社保公积金个人
     *
     * @return
     */
    public static SalaryFieldType personsihf() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.personsihf);
        fieldType.setName("社保公积金个人");
        //fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setGenTypeTotalField(true);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        return fieldType;
    }

    /**
     * 社保公积金公司
     *
     * @return
     */
    public static SalaryFieldType companysihf() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.companysihf);
        fieldType.setName("社保公积金公司");
        //fieldType.setCompanycostop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 税费
     *
     * @return
     */
    public static SalaryFieldType tax() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.tax);
        fieldType.setName("税费");
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 税后报销
     *
     * @return
     */
    public static SalaryFieldType aftertaxexpenses() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.aftertaxexpenses);
        fieldType.setName("税后报销");
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setPersonalsalaryop(NumOperation.ADD);
        fieldType.setGenTypeTotalField(true);

        return fieldType;
    }

    /**
     * 税后扣款
     *
     * @return
     */
    public static SalaryFieldType aftertaxdection() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.aftertaxdection);
        fieldType.setName("税后扣款");
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setPersonalsalaryop(NumOperation.SUBTRACT);
        fieldType.setSalaryTaxTypes(ImmutableList.of(TaxTypeHelper.salaryTaxType()));
        fieldType.setGenTypeTotalField(true);
        return fieldType;
    }

    /**
     * 统计
     *
     * @return
     */
    public static SalaryFieldType statistics() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.statistics);
        fieldType.setName("统计");
        fieldType.setGenTypeTotalField(false);
        return fieldType;
    }

    /**
     * 考勤
     *
     * @return
     */
    public static SalaryFieldType attendance() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.attendance);
        fieldType.setName("考勤");
        fieldType.setGenTypeTotalField(false);
        return fieldType;
    }

    /**
     * 其他收入
     *
     * @return
     */
    public static SalaryFieldType otherincome() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.otherincome);
        fieldType.setName("其他收入");
        fieldType.setGenTypeTotalField(false);
        return fieldType;
    }

    /**
     * 其他
     *
     * @return
     */
    public static SalaryFieldType other() {
        SalaryFieldType fieldType = new SalaryFieldType();
        fieldType.setCode(SalaryFieldType.Code.other);
        fieldType.setName("其他收入");
        fieldType.setGenTypeTotalField(false);
        return fieldType;
    }

}